{template 'common/header'}
<style>
.sub-search input,.sub-search select{margin-bottom:0;}
</style>
    <div class="main">
		<div class="stat">
			<div class="stat-div">
				<div class="navbar navbar-static-top">
					<div class="navbar-inner">
						<span class="brand" style="float:none;">
						<select name="rid" id="rid" onchange="window.location.href='index.php?act=module&do=awardlist&name=ggl&id='+this.value+'&page=1';">
						{loop $rules $row}
						<option value="{$row['id']}" {if $row['id'] == $id}selected="selected"{/if}>{$row['name']}</option>
						{/loop}
						</select>
						中奖名单
						</span>
					</div>
				</div>
	
				<div class="sub-item" id="table-list">
					<h4 class="sub-title">详细数据  |  总数:{$total}</h4>
					<form action="" method="post" onsubmit="" id="tijiao">
					<div class="sub-content">
						<table class="table table-hover">
							<thead class="navbar-inner">
								<tr>
									<th style="width:40px;" class="row-first">选择</td>
									<th style="width:100px;" class="row-hover">姓名<i></i></th>
									<th style="width:100px;">手机<i></i></th>
									<th style="width:100px;">QQ<i></i></th>
									<!-- <th style="width:100px;">性别<i></i></th> -->
									<th style="width:100px;">年龄<i></i></th>
									<th>NUM<i></i></th>
									<th>领取状态<i></i></th>
									<th style="width:150px;">获取时间<i></i></th>
								</tr>
							</thead>
							<tbody>
								{loop $list_award $row}
								<tr>
									<td class="row-first"><input type="checkbox" name="select[]" value="{$row['id']}" /></td>
									<td class="row-hover">{$row['nickname']}</td>
									<td>{$row['mobile']}</td>
									<td>{$row['qq']}</td>
									<!-- <td>{if $row['sex']==1}男{else}女{/if}</td> -->
									<td>{$row['age']}</td>
									<td>{$row['playnum']}</td>
									<td>{php $row['status'] == '2' ? '抢完了': ( $row['status'] == '1' ? '未领取' : '已领取');}</td>
									<td style="font-size:12px; color:#666;">
										{php echo date('Y-m-d h:i:s', $row[createtime]);}
									</td>
								</tr>
								{/loop}
							</tbody>
						</table>
						<table class="table">
							<tr>
								<td style="width:40px;" class="row-first"><input type="checkbox" onclick="selectall(this, 'select');" /></td>
								<td>
									<input type="submit" name="delete" value="已领取" class="btn btn-primary" />
									<input type="submit" name="delete" value="删除" class="btn btn-primary" />
									<input type="hidden" name="token" value="{$_W['token']}" />
								</td>
							</tr>
						</table>
					</div>
				</form>
				{$pager}
				</div>
			</div>
		</div>
    </div>

<script>
$(function() {
	//详细数据相关操作
	var tdIndex;
	$("#table-list thead").delegate("th", "mouseover", function(){
		if($(this).find("i").hasClass("")) {
			$("#table-list thead th").each(function() {
				if($(this).find("i").hasClass("icon-sort")) $(this).find("i").attr("class", "");
			});
			$("#table-list thead th").eq($(this).index()).find("i").addClass("icon-sort");
		}
	});
	$("#table-list thead th").click(function() {
		if($(this).find("i").length>0) {
			var a = $(this).find("i");
			if(a.hasClass("icon-sort") || a.hasClass("icon-caret-up")) { //递减排序
				/*
					数据处理代码位置
				*/
				$("#table-list thead th i").attr("class", "");
				a.addClass("icon-caret-down");
			} else if(a.hasClass("icon-caret-down")) { //递增排序
				/*
					数据处理代码位置
				*/
				$("#table-list thead th i").attr("class", "");
				a.addClass("icon-caret-up");
			}
			$("#table-list thead th,#table-list tbody:eq(0) td").removeClass("row-hover");
			$(this).addClass("row-hover");
			tdIndex = $(this).index();
			$("#table-list tbody:eq(0) tr").each(function() {
				$(this).find("td").eq(tdIndex).addClass("row-hover");
			});
		}
	});
});
</script>
{template 'common/footer'}